package com.kbot.bot.gui.loader;

import java.applet.AppletStub;
import java.applet.AppletContext;
import java.util.HashMap;
import java.net.URL;

/**
 * Created by IntelliJ IDEA.
 * User: Jan Ove
 * Date: 29.jan.2009
 * Time: 17:35:29
 * To change this template use File | Settings | File Templates.
 */
public class StubGenerator implements AppletStub {
    public HashMap<String, String> parameters = new HashMap<String, String>();
    public String worldId;

    public StubGenerator(String world) {
            this.worldId = world;
			parameters.put("height", "762");
			parameters.put("width", "503");
			parameters.put("worldid", world);
			parameters.put("members", "0");
			parameters.put("modewhat", "0");
			parameters.put("modewhere", "0");
			parameters.put("safemode", "0");
			parameters.put("lang", "0");
    }

    public void appletResize(int width, int height) {

    }

	public final URL getCodeBase() {
		try {
			return new URL("http://world"+worldId+".runescape.com");
		} catch (Exception e) {
			return null;
		}
	}

    public boolean isActive() {
        return false;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public final URL getDocumentBase() {
		try {
			return new URL("http://world"+worldId+".runescape.com/");
		} catch (Exception e) {
			return null;
		}
	}

	public final String getParameter(String name) {
		return parameters.get(name);
	}

	public final AppletContext getAppletContext() {
		return null;
	}
    public AppletStub getStub() {
        return this;
    }
}